package io.wins.vertx.entity;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;
import io.wins.vertx.utils.UUIDUtils;
import org.apache.commons.lang3.StringUtils;

@DataObject(generateConverter = true)
public class Carousel {
    private final String id;
    private String title;
    private String imageId;
    private String url;
    private int seq;
    private boolean isActive;
    private boolean isDelete;
    private String createdOn;
    private String updatedOn;

    public Carousel(final JsonObject json) {
        CarouselConverter.fromJson(json, this);
        this.id = StringUtils.isEmpty(json.getString("id")) ?
            UUIDUtils.genId() : json.getString("id");
    }

    public JsonObject toJson() {
        final JsonObject json = new JsonObject();
        CarouselConverter.toJson(this, json);
        return json;
    }

    public String getId() {
        return this.id;
    }

    public boolean isDelete() {
        return this.isDelete;
    }

    public void setDelete(final boolean delete) {
        this.isDelete = delete;
    }

    public String getTitle() {
        return this.title;

    }

    public void setTitle(final String title) {
        this.title = title;
    }

    public String getImageId() {
        return this.imageId;
    }

    public void setImageId(final String imageId) {
        this.imageId = imageId;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(final String url) {
        this.url = url;
    }

    public boolean isActive() {
        return this.isActive;
    }

    public void setActive(final boolean active) {
        this.isActive = active;
    }

    public int getSeq() {
        return this.seq;
    }

    public void setSeq(final int seq) {
        this.seq = seq;
    }

    public String getCreatedOn() {
        return this.createdOn;
    }

    public void setCreatedOn(final String createdOn) {
        this.createdOn = createdOn;
    }

    public String getUpdatedOn() {
        return this.updatedOn;
    }

    public void setUpdatedOn(final String updatedOn) {
        this.updatedOn = updatedOn;
    }
}
